//
//  AFClient.h
//  noteMan
//
//  Created by 周博 on 16/12/12.
//  Copyright © 2016年 BogoZhou. All rights reserved.
//

#import <Foundation/Foundation.h>
#if 0
//线下

#define kHttpHeader @"http://106.15.93.115/nothing/market"
//https://192.168.16.134
#else
//线上

#define kHttpHeader @"https://www.wacdd.com/nothing/market"
#endif
@interface AFClient : NSObject

typedef void(^ProgressBlock)(NSProgress *progress);
typedef void(^SuccessBlock)(id responseBody);
typedef void(^FailureBlcok)(NSError *error);

@property (nonatomic,strong)ProgressBlock progressBolck;
@property (nonatomic,strong)SuccessBlock successBlock;
@property (nonatomic,strong)FailureBlcok failureBlock;


+(instancetype)shareInstance;

#pragma mark - Verson 1

//0.获取服务器时间戳
- (void)getSeverDateProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

#pragma mark - 短信

//1.发送短信
- (void)getCodeByMobile:(NSString *)mobile progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//2.登录：通过短信验证码
- (void)loginByMobile:(NSString *)mobile code:(NSString *)code progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

#pragma mark - 店铺

//3.身份检查
- (void)checkMobile:(NSString *)mobile progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//4.权限菜单
- (void)getMenuByEid:(NSString *)eid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//5.设为已铺设
- (void)setToHasUsedById:(NSString *)shopId eid:(NSString *)eid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//6.删除(将已铺设店铺删除)
- (void)deleteShopById:(NSString *)shopId eid:(NSString *)eid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//7.更新店铺信息
- (void)updateShopInfoByShopId:(NSString *)shopId eid:(NSString *)eid name:(NSString *)name contact:(NSString *)contact tel:(NSString *)tel latitude:(NSString *)latitude longitude:(NSString *)longitude province_id:(NSString *)province_id city_id:(NSString *)city_id area_id:(NSString *)area_id specific_address:(NSString *)specific_address province_name:(NSString *)province_name city_name:(NSString *)city_name area_name:(NSString *)area_name position:(NSString *)position position_name:(NSString *)position_name img_url:(NSString *)img_url from_type:(NSString *)from_type remark:(NSString *)remark progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//8.新建店铺信息
- (void)newShopInfoByEid:(NSString *)eid name:(NSString *)name contact:(NSString *)contact tel:(NSString *)tel latitude:(NSString *)latitude longitude:(NSString *)longitude province_id:(NSString *)province_id city_id:(NSString *)city_id area_id:(NSString *)area_id specific_address:(NSString *)specific_address province_name:(NSString *)province_name city_name:(NSString *)city_name area_name:(NSString *)area_name position:(NSString *)position position_name:(NSString *)position_name img_url:(NSString *)img_url from_type:(NSString *)from_type remark:(NSString *)remark progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//9.商家分页信息
- (void)getShopListByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index status:(NSString *)status store_type:(NSString *)store_type progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//10.所属充电宝
- (void)powerBelongByShopId:(NSString *)shopId eid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

#pragma mark - 充电宝

//解析扫一扫得到的字符串
- (void)upLoadQRCodeInfoByEid:(NSString *)eid qrcode:(NSString *)qrcode progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//查找充电宝
- (void)findPowerByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//查找充电宝 手写
- (void)findPowerWriteByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//激活充电宝
- (void)activePowerByEid:(NSString *)eid alias:(NSString *)alias name:(NSString *)name remark:(NSString *)remark store_info_id:(NSString *)store_info_id latitude:(NSString *)latitude longitude:(NSString *)longitude progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//更新充电宝
- (void)updatePowerByEid:(NSString *)eid alias:(NSString *)alias name:(NSString *)name remark:(NSString *)remark store_info_id:(NSString *)store_info_id progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：查询是否成功通知了充电宝
- (void)checkPostToPowerByMessage_id:(NSString *)message_id progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：通知充电
- (void)postNotiToGetPowerByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：检查状态（在线）
- (void)checkTypeGetPowerByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//撤回设备
- (void)recallPowerByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//硬件故障
- (void)brokenPowerByEid:(NSString *)eid alias:(NSString *)alias content:(NSString *)content progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：查询固件
- (void)findPowerNotiByPowerByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：更新固件
- (void)updatePowerVersonByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

#pragma mark - 配置
//获取充电宝版本
- (void)getNewVersonAboutPowerProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//获取最新版本
- (void)getNewVersonProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

#pragma mark - 上传
- (void)uploadImageByImage:(UIImage *)image progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//配置WiFi
- (void)postUPdateWiFiInfoByStaN:(NSString *)staN staP:(NSString *)staP mac:(NSString *)mac ver:(NSString *)ver ProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

- (void)getMacInfoProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//获取统计数据
- (void)getMainMessageByUserId:(NSString *)eid ProgressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//分页信息（简单数据）
- (void)getShopSimpleListByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index status:(NSString *)status progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//单个店铺按日期查询
- (void)SingleShopSearchByEid:(NSString *)eid sid:(NSString *)sid start_date:(NSString *)start_date end_date:(NSString *)end_date progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//指令：控制绿灯
- (void)contrlLightByAlias:(NSString *)alias eid:(NSString *)eid status:(NSString *)status progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//个人历史统计
- (void)userHistorySearchByEid:(NSString *)eid start_date:(NSString *)start_date end_date:(NSString *)end_date progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//进入 统计数据里面的页面要的数据
- (void)tongjiByEid:(NSString *)eid date:(NSString *)date progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//店铺今日达标情况
- (void)dabiaoByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//个人提成历史记录
- (void)GetCommistionHistoryInfoByEid:(NSString *)eid start_date:(NSString *)start_date end_date:(NSString *)end_date progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//寄回工厂
- (void)sendFactoryByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//已安装充电宝分页
- (void)hasInstalledPowerByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index electricity_sc_status:(NSString *)electricity_sc_status on_line_sc_status:(NSString *)on_line_sc_status on_line:(NSString *)on_line dump_energy_per:(NSString *)dump_energy_per offline_day:(NSString *)offline_day device_type:(NSString *)device_type progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//获取充电宝硬件故障
- (void)getPowerErrorInfoByAlias:(NSString *)alias eid:(NSString *)eid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;


//待维护页面的分页信息
- (void)waitingRepairByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index offline_rate:(NSString *)offline_rate progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//待维护页面的分页信息v2
- (void)waitingRepairByEid:(NSString *)eid page_size:(NSString *)page_size page_index:(NSString *)page_index date:(NSString *)date status:(NSString *)status progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//待维护店铺的 充电宝详情 v2
- (void)waitingRepairDetailByEid:(NSString *)eid date:(NSString *)date charging_info_ids:(NSString*)charging_info_ids progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//密码：熊大大版【初次】获取密码
- (void)powerGetPasswordFirstTimeByEid:(NSString *)eid alias:(NSString *)alias progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//密码：熊大大版【再次】获取密码
- (void)powerGetPasswordAgainByEid:(NSString *)eid alias:(NSString *)alias step:(NSString *)step progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

///v1/employee/all获取全部人员
- (void)getAllUsersByEid:(NSString *)eid oid:(NSString *)oid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

- (void)waitToHasUsedById:(NSString *)shopId eid:(NSString *)eid progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

//待维护店铺的 充电宝详情 v2 今日
- (void)waitingRepairDetailJinRiByEid:(NSString *)eid date:(NSString *)date charging_info_ids:(NSString*)charging_info_ids progressBlock:(ProgressBlock)progress success:(SuccessBlock)success failure:(FailureBlcok)failure;

@end
